<?php
namespace c;

/**
 * Description of ai
 *
 * @author YeFng
 */
class ai extends \m\ad
{
    function __construct()
    {
        parent::__construct();
        $this->PU->login();
	}
	function index_home()
    {
        $this->dispLayout = 'tlm';

    }
    function index_main()
    {   
		$tr['userNum'] = $this->db->getOneField('user',  'count(*)');
		$tr['goodsNum'] = $this->db->getOneField('goods',  'count(*)');
		
		$a = $this->db->group('state')->get('shop_order',  'state, count(*) num');
		$st = \YF_f::initC('\c\shop\order\g')->State;
		$st = \lang::Ag_p($st, 'ord_state');
		foreach ($a as $k=>$v)
			$a[$k]['state_name'] = $st[$v['state']];
		$tr['orders'] = $a;
		$this->loadTemplate('welcome', $tr);
    }
}
